package com.yc.cloud.common.oss.enums;

import com.yc.cloud.common.basic.enums.IEnumCode;
import lombok.AllArgsConstructor;
import lombok.Getter;


@Getter
@AllArgsConstructor
public enum OssCategoryEnums implements IEnumCode {
    /***
     * description: 图片格式
     */
    IMAGE("image", "jpg,png,jpeg"),
    AUDIO("audio", "mp3,wav"),
    /***
     * description: 视频格式
     */
    VIDEO("video", "mp4"),

    WORD("word", "doc,docx,pdf"),

    MODEL("model", "glb");

    /**
     * 状态码
     */
    final String code;
    /**
     * 消息内容
     */
    final String description;

    public static boolean isValidEnum(String code) {
        for (OssCategoryEnums fundStatusEnum : OssCategoryEnums.values()) {
            if (fundStatusEnum.code.equals(code)) {
                return true;
            }
        }
        return false;
    }

    public static String getDescription(String code) {
        for (OssCategoryEnums fundStatusEnum : OssCategoryEnums.values()) {
            if (fundStatusEnum.code.equals(code)) {
                return fundStatusEnum.description;
            }
        }
        return null;
    }


};
